import {mapGetters} from 'vuex'

export default{
  computed:{
    ...mapGetters('my_cart',['total'])
  },
  watch:{
    total(){
      this.getbadge()
    }
  },
  onShow(){
    this.getbadge()
  },
  methods:{
    getbadge(){
      uni.setTabBarBadge({
        index:2,
        text:this.total + ''
      })
    }
  }
}